package com.czk.interfaces;

import java.util.Objects;

/**
 * 分表策略接口
 *
 * @Author:ChenZhangKun
 * @Date: 2021/5/17 9:54
 */
public interface ITableSharedStrategy {
    /**
     * 生成表的名称
     *
     * @param prefix 前缀
     * @param value  值
     * @return
     */
    String generateTableName(String prefix, Object value);

    /**
     * 验证表名称前缀
     *
     * @param tableNamePrefix
     */
    default void verificationTableNamePrefix(String tableNamePrefix) {
        if (Objects.equals("", tableNamePrefix) || tableNamePrefix == null) {
            throw new RuntimeException("tableNamePrefix is null");
        }
    }
}
